####
# 
# File: sfxStudy
# 
# (C) Copyright 2019. All rights reserved.
# 
# Author: ShenYongchen (shenyczz@163.com)
# 
###############################################################################
# 
if(SFX_MACRO_MESSAGE_SWITCH)
  message(STATUS "sfx runing - ${CMAKE_CURRENT_LIST_FILE}")
endif()

#[==[
  @note
#--------------------------------------------------------------------------]==]

# macro(<name> [arg1 [arg2 [arg3 ...]]])
#   COMMAND1(ARGS ...)
#   COMMAND2(ARGS ...)
#   ...
# endmacro(<name>)


#[==[ sfx_study_macro_argn(arg0 arg1)
  macro,function中ARGV,ARGN参数的区别

  cmake中的宏(macro)和函数(function)都支持动态参数

  ARGC: 传入参数的个数
  ARGV: 传入参数的列表, 所有参数
  ARGN: 传入参数的列表，但不是所有参数，而是指macro/function声明的参数之后的所有传入参数
  ARGV0,ARGV1,...顺序代表传入的参数
#--------------------------------------------------------------------------]==]

# 
macro(sfx_study_macro_argn arg0 arg1)
  message(STATUS "传入参数的个数: ARGC = " ${ARGC})
  message(STATUS "传入参数的列表: ARGV = " ${ARGV})
  message(STATUS "传入参数的列表: ARGN = " ${ARGN})
	message(STATUS "ARGV0 = " ${ARGV0})
	message(STATUS "ARGV1 = " ${ARGV1})
	message(STATUS "ARGV2 = " ${ARGV2})
	message(STATUS "ARGV3 = " ${ARGV3})
endmacro()
# 调用宏时传入4个参数
# sfx_argn_test(TOM JERRY SUSAN BERN)

# cmake脚本执行输出结果，ARGN为声明参数之后的所有参数
# -- ARGV=TOMJERRYSUSANBERN
# -- ARGN=SUSANBERN
# -- ARGV0=TOM
# -- ARGV1=JERRY
# -- ARGV2=SUSAN
# -- ARGV3=BERN

